<?php
/**
 * $Id: index.php 428 2006-07-08 08:19:03Z tito $
 *
 * FGS is the legal property of its developers, whose names are too numerous
 * to list here.  Please refer to the COPYRIGHT file distributed with this
 * source distribution.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

if (!file_exists('config.php')) {
	header('Content-Type: text/plain');	
	die('fgs-backend not configured yet.');
}

// session
ini_set('session.use_only_cookies', 1);
session_name('fgsbackend');
session_start();

// inclusions
include('api/fgs.php');
include('scripts/class/base.class.php');
include('scripts/class/html_table.class.php');
include('scripts/class/html_form.class.php');
include('scripts/class/html_list.class.php');

// init fgs api
fgs::init();

// search page
$base = new fgsBase();
$base->addPage('main');
$base->addPage('lang');
$base->addPage('proxys');
$base->addPage('news');
$base->addPage('games');
$base->addPage('game');
$base->addPage('players');
$base->addPage('player');
$base->addPage('stats');
$base->addPage('matchs');
$base->addPage('match');
$base->addPage('log');
$base->addPage('logout');
$base->addPage('register');
$base->addPage('admin');
$base->addPage('admin_news');
$base->addPage('admin_games');
$base->addPage('admin_players');
$base->addPage('admin_matchs');
$base->addPage('admin_proxys');
$base->addPage('admin_config');
$base->addPage('admin_commands');

$base->setPageParam('header', 'cache', true);
$base->setPageParam('header', 'cache_salt', fgsLang::getLang());
$base->setPageParam('header', 'cache_lifetime', 3600);
$base->setPageParam('footer', 'cache', true);
$base->setPageParam('footer', 'cache_salt', fgsLang::getLang());
$base->setPageParam('footer', 'cache_lifetime', 3600);
$base->setPageParam('match', 'cache', true);
$base->setPageParam('match', 'cache_lifetime', 3600);
$base->setPageParam('match', 'cache_salt', fgsLang::getLang());

$base->setPageParam('admin', 'auth', true);
$base->setPageParam('admin_news', 'auth', true);
$base->setPageParam('admin_games', 'auth', true);
$base->setPageParam('admin_players', 'auth', true);
$base->setPageParam('admin_matchs', 'auth', true);
$base->setPageParam('admin_proxys', 'auth', true);
$base->setPageParam('admin_config', 'auth', true);
$base->setPageParam('admin_commands', 'auth', true);

$base->run();

?>
